package c.c.a;

import android.view.View;
import android.view.ViewGroup;
import androidx.recyclerview.widget.RecyclerView;
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout;
import com.tencent.smtt.sdk.WebView;
import java.lang.reflect.Method;

public class e0 {
    public static boolean a = false;
    public static Class b;
    public static Method c;
    public static boolean d = b("com.tencent.smtt.sdk.WebView");
    public static boolean e;
    public static boolean f;
    public static boolean g;
    public static boolean h;
    public static boolean i;
    public static boolean j;
    public static boolean k;
    public static boolean l;
    public static boolean m;
    public static boolean n;

    static {
        String str = "androidx.recyclerview.widget.RecyclerView";
        e = b(str);
        String str2 = "androidx.viewpager.widget.ViewPager";
        f = b(str2);
        String str3 = "androidx.swiperefreshlayout.widget.SwipeRefreshLayout";
        g = b(str3);
        String str4 = "androidx.fragment.app.Fragment";
        b(str4);
        String str5 = "androidx.fragment.app.FragmentActivity";
        b(str5);
        String str6 = "androidx.appcompat.app.AlertDialog";
        h = b(str6);
        String str7 = "androidx.appcompat.view.menu.ListMenuItemView";
        i = b(str7);
        j = b(str);
        k = b(str2);
        l = b(str3);
        b(str4);
        b(str5);
        m = b(str6);
        n = b(str7);
    }

    public static Class<?> a(Class<?> cls) {
        Object cls2;
        while (cls2 != null && !cls2.equals(ViewGroup.class)) {
            try {
                c = cls2.getDeclaredMethod("getChildAdapterPosition", new Class[]{View.class});
            } catch (NoSuchMethodException unused) {
            }
            if (c == null) {
                try {
                    c = cls2.getDeclaredMethod("getChildPosition", new Class[]{View.class});
                } catch (NoSuchMethodException unused2) {
                }
            }
            if (c != null) {
                return cls2;
            }
            cls2 = cls2.getSuperclass();
        }
        return null;
    }

    public static boolean b(String str) {
        try {
            Class.forName(str);
            return true;
        } catch (Throwable unused) {
            return false;
        }
    }

    public static boolean c(Object obj) {
        return e && (obj instanceof RecyclerView);
    }

    public static boolean d(Object obj) {
        return j && (obj instanceof RecyclerView);
    }

    public static boolean e(Object obj) {
        return g && (obj instanceof SwipeRefreshLayout);
    }

    public static boolean f(Object obj) {
        return l && (obj instanceof SwipeRefreshLayout);
    }

    public static boolean g(Object obj) {
        return d && (obj instanceof WebView);
    }
}
